import {FC} from "react";
import {Modal, ModalProps} from "antd";
import {CloudUploadOutlined} from "@ant-design/icons";
import UploadFile from "../form/uploadFile";
import "./UploadModal.less";

interface UploadModalProps extends ModalProps {
    icon?: any;
    success: any;
}

const UploadModal: FC<UploadModalProps> = ({open, title, icon = "", onCancel, success, onOk, ...rest}) =>
    open && (
        <Modal title={title} open={open} onCancel={onCancel} onOk={onOk} {...rest}>
            <UploadFile
                url="excel"
                setImg={success}
                icon={
                    <div>
                        <CloudUploadOutlined style={{fontSize: 100, color: "#4d68cd"}} />
                        <div>上传文件</div>
                    </div>
                }
                className="modal-upload"
            />
        </Modal>
    );
export default UploadModal;
